/*
 Navicat Premium Data Transfer

 Source Server         : oracle11g-24
 Source Server Type    : Oracle
 Source Server Version : 110200
 Source Host           : 192.168.2.24:1521
 Source Schema         : GYTOKD

 Target Server Type    : Oracle
 Target Server Version : 110200
 File Encoding         : 65001

 Date: 31/03/2023 11:42:50
*/


-- ----------------------------
-- Table structure for BASE_GROUPS
-- ----------------------------
DROP TABLE "GYTOKD"."BASE_GROUPS";
CREATE TABLE "GYTOKD"."BASE_GROUPS" (
  "ID" NUMBER(19,0) NOT NULL,
  "PARENTID" NUMBER(19,0) NOT NULL,
  "PNAME" NVARCHAR2(200),
  "COMPANY" NUMBER(11,0) NOT NULL,
  "NASGROUP_ID" NUMBER(11,0) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for BASE_USERS
-- ----------------------------
DROP TABLE "GYTOKD"."BASE_USERS";
CREATE TABLE "GYTOKD"."BASE_USERS" (
  "ID" NUMBER(11,0) NOT NULL,
  "USERNAME" NVARCHAR2(64),
  "PASSWORD" NVARCHAR2(128),
  "POSITION" NVARCHAR2(64),
  "USERID" NVARCHAR2(64),
  "UNIONID" NVARCHAR2(64),
  "MOBILE" NVARCHAR2(20),
  "AVATAR" NVARCHAR2(150),
  "LAST_LOGIN_DATE" TIMESTAMP(6),
  "PERMISSION" NUMBER(11,0) DEFAULT NULL NOT NULL,
  "OP_DATE" TIMESTAMP(6)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for BASE_USER_GROUP
-- ----------------------------
DROP TABLE "GYTOKD"."BASE_USER_GROUP";
CREATE TABLE "GYTOKD"."BASE_USER_GROUP" (
  "ID" NUMBER(19,0) NOT NULL,
  "GID_ID" NUMBER(19,0) NOT NULL,
  "UID_ID" NUMBER(11,0) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for BASE_USER_INFO
-- ----------------------------
DROP TABLE "GYTOKD"."BASE_USER_INFO";
CREATE TABLE "GYTOKD"."BASE_USER_INFO" (
  "ID" NUMBER(11,0) NOT NULL,
  "COMPANY" NUMBER(11,0) NOT NULL,
  "IS_ACTIVE" NUMBER(11,0) NOT NULL,
  "USERNAME" NVARCHAR2(64),
  "POSITION" NVARCHAR2(64),
  "EMAIL" NVARCHAR2(64),
  "USERID" NVARCHAR2(64),
  "UNIONID" NVARCHAR2(64),
  "TEL" NVARCHAR2(10),
  "WORKPLACE" NVARCHAR2(50),
  "REMARK" NVARCHAR2(255),
  "MOBILE" NVARCHAR2(20),
  "ORGEMAIL" NVARCHAR2(100),
  "ISLEADERINDEPTS" NVARCHAR2(200),
  "DEPARTMENT" NVARCHAR2(100),
  "AVATAR" NVARCHAR2(150),
  "HIREDDATE" TIMESTAMP(6),
  "JOBNUMBER" NVARCHAR2(20),
  "EXTATTR" NCLOB,
  "UID_ID" NUMBER(11,0) NOT NULL,
  "LEAVEDATE" TIMESTAMP(6),
  "OP_DATE" TIMESTAMP(6)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for IMED_CUSTOMERCODE
-- ----------------------------
DROP TABLE "GYTOKD"."IMED_CUSTOMERCODE";
CREATE TABLE "GYTOKD"."IMED_CUSTOMERCODE" (
  "ID" NUMBER(19,0) NOT NULL,
  "KDID" NUMBER(11,0) NOT NULL,
  "CODE" NVARCHAR2(30),
  "NAME" NVARCHAR2(100),
  "KDNUMBER" NVARCHAR2(30),
  "STATUS" NUMBER(1,0) NOT NULL,
  "ORG" NVARCHAR2(5),
  "DEPTID" NVARCHAR2(10),
  "UP_DATE" TIMESTAMP(6),
  "KDNAME" NVARCHAR2(100)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for IMED_GYITEMCODE
-- ----------------------------
DROP TABLE "GYTOKD"."IMED_GYITEMCODE";
CREATE TABLE "GYTOKD"."IMED_GYITEMCODE" (
  "ID" NUMBER(19,0) NOT NULL,
  "GYITEMID" NUMBER(19,0) NOT NULL,
  "GYCODE" NVARCHAR2(30),
  "GYBARCODE" NVARCHAR2(13),
  "GYNAME" NVARCHAR2(255),
  "STATUS" NUMBER(1,0) NOT NULL,
  "FBARCODE" NVARCHAR2(13),
  "FMATERIALID" NUMBER(11,0) DEFAULT NULL NOT NULL,
  "FNAME" NVARCHAR2(255),
  "FNUMBER" NVARCHAR2(30),
  "FBASEUNIT" NVARCHAR2(13),
  "UP_DATE" TIMESTAMP(6),
  "ERPCLSID" NVARCHAR2(1) DEFAULT NULL,
  "GYVOLUME" FLOAT(126) DEFAULT NULL NOT NULL,
  "GYWEIGHT" FLOAT(126) DEFAULT NULL NOT NULL,
  "KDHEIGHT" FLOAT(126) DEFAULT NULL NOT NULL,
  "KDLENGTH" FLOAT(126) DEFAULT NULL NOT NULL,
  "KDVOLUME" FLOAT(126) DEFAULT NULL NOT NULL,
  "KDVOLUMEUNIT" NVARCHAR2(2) DEFAULT NULL,
  "KDWEIGHT" FLOAT(126) DEFAULT NULL NOT NULL,
  "KDWEIGHTUNIT" NVARCHAR2(2) DEFAULT NULL,
  "KDWIDTH" FLOAT(126) DEFAULT NULL NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for IMED_KDSTOCKCODE
-- ----------------------------
DROP TABLE "GYTOKD"."IMED_KDSTOCKCODE";
CREATE TABLE "GYTOKD"."IMED_KDSTOCKCODE" (
  "ID" NUMBER(19,0) NOT NULL,
  "FSTOCKID" NUMBER(11,0) NOT NULL,
  "FNUMBER" NVARCHAR2(30),
  "FNAME" NVARCHAR2(90),
  "FTHIRDSTOCKNO" NVARCHAR2(30),
  "STATUS" NUMBER(1,0) NOT NULL,
  "UP_DATE" TIMESTAMP(6),
  "ORG" NVARCHAR2(5) DEFAULT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for KD2MES_PROD_ORDERS
-- ----------------------------
DROP TABLE "GYTOKD"."KD2MES_PROD_ORDERS";
CREATE TABLE "GYTOKD"."KD2MES_PROD_ORDERS" (
  "ROW_ID" VARCHAR2(36 BYTE) NOT NULL,
  "MO" VARCHAR2(50 BYTE),
  "FENTITY" NUMBER(11,0),
  "MO_ITEM" VARCHAR2(30 BYTE),
  "MO_STATUS" VARCHAR2(1 BYTE),
  "MO_DATE" TIMESTAMP(6),
  "MO_MODIFY" TIMESTAMP(6),
  "MO_APPROVE" TIMESTAMP(6),
  "STATUS" VARCHAR2(1 BYTE),
  "MO_SEND" NUMBER(5,0),
  "PPBOM" VARCHAR2(50 BYTE),
  "PPBOM_STATUS" VARCHAR2(1 BYTE),
  "PPBOM_APPROVE" TIMESTAMP(6),
  "PPBOM_SEND" VARCHAR2(5 BYTE),
  "MO_RESULT" NCLOB,
  "PPBOM_RESULT" NCLOB,
  "FID" NUMBER(11,0)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for KD2MES_STOCK_ORDERS
-- ----------------------------
DROP TABLE "GYTOKD"."KD2MES_STOCK_ORDERS";
CREATE TABLE "GYTOKD"."KD2MES_STOCK_ORDERS" (
  "CODE" VARCHAR2(30 BYTE) NOT NULL,
  "OTYPE" VARCHAR2(5 BYTE),
  "FDATE" TIMESTAMP(6),
  "MODIFY_DATE" TIMESTAMP(6),
  "APPROVE_DATE" TIMESTAMP(6),
  "STATUS" VARCHAR2(1 BYTE),
  "SEND" NUMBER(5,0),
  "RESULT" NCLOB,
  "FID" NUMBER(11,0)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for OUTSTOCKREV
-- ----------------------------
DROP TABLE "GYTOKD"."OUTSTOCKREV";
CREATE TABLE "GYTOKD"."OUTSTOCKREV" (
  "ID" NUMBER(11,0) NOT NULL,
  "OUTSTOCKSUMID" NUMBER(11,0),
  "FENTITY" NUMBER(1,0) NOT NULL,
  "FDATE" TIMESTAMP(6) NOT NULL,
  "FGYBILLNO" NVARCHAR2(20),
  "FSHOPNUMBER" NVARCHAR2(20),
  "FSTOCKNUMBER" NVARCHAR2(20),
  "SUMSTATUS" NUMBER(11,0) NOT NULL,
  "FENTITYINFO" NCLOB
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for OUTSTOCKSUM
-- ----------------------------
DROP TABLE "GYTOKD"."OUTSTOCKSUM";
CREATE TABLE "GYTOKD"."OUTSTOCKSUM" (
  "ID" NUMBER(11,0) NOT NULL,
  "FDATE" TIMESTAMP(6) NOT NULL,
  "FGYBILLNO" NVARCHAR2(20),
  "FSHOPNUMBER" NVARCHAR2(20),
  "FSTOCKNUMBER" NVARCHAR2(20),
  "SUMINFO" NVARCHAR2(255),
  "KDRESULTID" NVARCHAR2(20),
  "RESULT" NVARCHAR2(2000),
  "FENTITY" NUMBER(1,0) NOT NULL,
  "STATUS" NUMBER(1,0),
  "STAT" NUMBER(11,0) DEFAULT NULL NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for OUTSTOCKSUMFENTITY
-- ----------------------------
DROP TABLE "GYTOKD"."OUTSTOCKSUMFENTITY";
CREATE TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" (
  "ID" NUMBER(11,0) NOT NULL,
  "FALLAMOUNT" FLOAT(126) NOT NULL,
  "FAMOUNT" FLOAT(126) NOT NULL,
  "FDISCOUNT" FLOAT(126) NOT NULL,
  "FFEEAMOUNT" FLOAT(126) NOT NULL,
  "FISFREE" NUMBER(1,0) NOT NULL,
  "FMATERIALNUMBER" NVARCHAR2(20),
  "FPRICE" FLOAT(126) NOT NULL,
  "FQTY" NUMBER(11,0) NOT NULL,
  "FSERVICEAMOUNT" FLOAT(126) NOT NULL,
  "OUTSTOCKID_ID" NUMBER(11,0) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for PUBLIC_WIFIINFO
-- ----------------------------
DROP TABLE "GYTOKD"."PUBLIC_WIFIINFO";
CREATE TABLE "GYTOKD"."PUBLIC_WIFIINFO" (
  "NAME" NVARCHAR2(20) NOT NULL,
  "PASSWORD" NVARCHAR2(32),
  "DATE" TIMESTAMP(6),
  "NOTE" NVARCHAR2(255)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for ROBOT_MESSAGES
-- ----------------------------
DROP TABLE "GYTOKD"."ROBOT_MESSAGES";
CREATE TABLE "GYTOKD"."ROBOT_MESSAGES" (
  "ID" NUMBER(19,0) NOT NULL,
  "TALK_ID" NUMBER(19,0) NOT NULL,
  "TITLE" NVARCHAR2(100),
  "MESSAGE" NCLOB,
  "RUN_TIME" TIMESTAMP(6),
  "LOST_TIME" TIMESTAMP(6),
  "STATUS" NUMBER(11,0) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for ROBOT_TALKS
-- ----------------------------
DROP TABLE "GYTOKD"."ROBOT_TALKS";
CREATE TABLE "GYTOKD"."ROBOT_TALKS" (
  "ID" NUMBER(19,0) NOT NULL,
  "NAME" NVARCHAR2(100),
  "ACCESS" NVARCHAR2(100),
  "SECRET" NVARCHAR2(100),
  "STATUS" NUMBER(1,0) NOT NULL,
  "NOTE" NVARCHAR2(255)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for STOCK_PURCHASEORDER
-- ----------------------------
DROP TABLE "GYTOKD"."STOCK_PURCHASEORDER";
CREATE TABLE "GYTOKD"."STOCK_PURCHASEORDER" (
  "ID" NUMBER(11,0) NOT NULL,
  "EID" NUMBER(11,0) DEFAULT NULL,
  "MODIFYDATETIME" TIMESTAMP(6),
  "KDFBILLNO" NVARCHAR2(30),
  "KDDATETIME" TIMESTAMP(6),
  "GYFBILLNO" NVARCHAR2(30),
  "GYDATETIME" TIMESTAMP(6),
  "COMPLETE" NUMBER(11,0) NOT NULL,
  "NOTE" NVARCHAR2(255),
  "FSTOCKID" NUMBER(11,0) DEFAULT NULL NOT NULL,
  "FSTOCKNO" NVARCHAR2(30),
  "MATERIALID" NVARCHAR2(30),
  "MUSTQTY" NUMBER(11,0) DEFAULT NULL NOT NULL,
  "PRICE" FLOAT(126) DEFAULT NULL NOT NULL,
  "REALQTY" NUMBER(11,0) DEFAULT NULL NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for SYS_GYERP_USERS
-- ----------------------------
DROP TABLE "GYTOKD"."SYS_GYERP_USERS";
CREATE TABLE "GYTOKD"."SYS_GYERP_USERS" (
  "ID" NUMBER(19,0) NOT NULL,
  "BASE_USER_ID" NUMBER(11,0),
  "NAME" NVARCHAR2(20),
  "MOBILE" NVARCHAR2(20),
  "STATUS" NUMBER(11,0) NOT NULL,
  "DISABLE_TIME" TIMESTAMP(6)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for SYS_KINGDEE_DATACENTER
-- ----------------------------
DROP TABLE "GYTOKD"."SYS_KINGDEE_DATACENTER";
CREATE TABLE "GYTOKD"."SYS_KINGDEE_DATACENTER" (
  "ID" NVARCHAR2(20) NOT NULL,
  "NAME" NVARCHAR2(100),
  "USER" NVARCHAR2(50),
  "PWD" NVARCHAR2(50),
  "TEST" NUMBER(1,0) NOT NULL,
  "ADDRESS" NVARCHAR2(150)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for SYS_KINGDEE_USERS
-- ----------------------------
DROP TABLE "GYTOKD"."SYS_KINGDEE_USERS";
CREATE TABLE "GYTOKD"."SYS_KINGDEE_USERS" (
  "ID" NUMBER(19,0) NOT NULL,
  "ACCT_ID" NVARCHAR2(20),
  "BASE_USER_ID" NUMBER(11,0),
  "NAME" NVARCHAR2(20),
  "MOBILE" NVARCHAR2(20),
  "FORBIDSTATUS" NVARCHAR2(1),
  "FDISABLETIME" TIMESTAMP(6),
  "FAPPGROUP" NVARCHAR2(10),
  "STATUS" NUMBER(11,0) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for SYS_NAS_GROUP
-- ----------------------------
DROP TABLE "GYTOKD"."SYS_NAS_GROUP";
CREATE TABLE "GYTOKD"."SYS_NAS_GROUP" (
  "ID" NUMBER(11,0) NOT NULL,
  "APP_GROUP_ID" NUMBER(11,0) NOT NULL,
  "APP_GROUP_NAME" NVARCHAR2(200),
  "PNAME" NVARCHAR2(200),
  "CHECKED" NUMBER(1,0) DEFAULT NULL NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for SYS_NAS_USER
-- ----------------------------
DROP TABLE "GYTOKD"."SYS_NAS_USER";
CREATE TABLE "GYTOKD"."SYS_NAS_USER" (
  "ID" NUMBER(11,0) NOT NULL,
  "APP_USER_ID" NUMBER(11,0),
  "APP_USER_NAME" NVARCHAR2(16),
  "STATUS" NUMBER(1,0) NOT NULL,
  "GROUP_ID" NUMBER(11,0) NOT NULL,
  "CHECKED" NUMBER(1,0) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for TASKS_JOBEXEC
-- ----------------------------
DROP TABLE "GYTOKD"."TASKS_JOBEXEC";
CREATE TABLE "GYTOKD"."TASKS_JOBEXEC" (
  "ID" NUMBER(11,0) NOT NULL,
  "STATUS" NUMBER(11,0) DEFAULT NULL,
  "STARTED" TIMESTAMP(6),
  "FINISHED" TIMESTAMP(6),
  "EXCEPTION" NVARCHAR2(1000),
  "TRACEBACK" NCLOB,
  "JOB_ID" NVARCHAR2(32),
  "NAME" NVARCHAR2(255) DEFAULT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for TASKS_JOBS
-- ----------------------------
DROP TABLE "GYTOKD"."TASKS_JOBS";
CREATE TABLE "GYTOKD"."TASKS_JOBS" (
  "ID" NVARCHAR2(32) NOT NULL,
  "NAME" NVARCHAR2(255),
  "NEXT_RUN_TIME" TIMESTAMP(6),
  "CRONEXPRESSION" NVARCHAR2(255),
  "DESCRIPTION" NVARCHAR2(255),
  "UP_STATUS" NUMBER(1,0) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for TEMP_KEYVALUE
-- ----------------------------
DROP TABLE "GYTOKD"."TEMP_KEYVALUE";
CREATE TABLE "GYTOKD"."TEMP_KEYVALUE" (
  "ID" NUMBER(11,0) NOT NULL,
  "KVKEY" NVARCHAR2(40),
  "KVVALUE" NVARCHAR2(255),
  "KVTS" NUMBER(19,0) NOT NULL,
  "KVDT" TIMESTAMP(6)
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
ENABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for XIAOSHOU_KANBAN
-- ----------------------------
DROP TABLE "GYTOKD"."XIAOSHOU_KANBAN";
CREATE TABLE "GYTOKD"."XIAOSHOU_KANBAN" (
  "ID" NUMBER(11,0) NOT NULL,
  "SHOP" NVARCHAR2(20),
  "PERSON" NVARCHAR2(20),
  "DATE" NVARCHAR2(20),
  "PERSENT" NUMBER(11,0) NOT NULL,
  "USER" NUMBER(11,0) NOT NULL,
  "MODIFY_DATE" TIMESTAMP(6) NOT NULL
)
TABLESPACE "GY_DATA_SPACE"
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Sequence structure for AUTH_GROUP_PERMISSIONS_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."AUTH_GROUP_PERMISSIONS_SQ";
CREATE SEQUENCE "GYTOKD"."AUTH_GROUP_PERMISSIONS_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for AUTH_GROUP_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."AUTH_GROUP_SQ";
CREATE SEQUENCE "GYTOKD"."AUTH_GROUP_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for AUTH_PERMISSION_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."AUTH_PERMISSION_SQ";
CREATE SEQUENCE "GYTOKD"."AUTH_PERMISSION_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for AUTH_USER_GROUPS_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."AUTH_USER_GROUPS_SQ";
CREATE SEQUENCE "GYTOKD"."AUTH_USER_GROUPS_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for AUTH_USER_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."AUTH_USER_SQ";
CREATE SEQUENCE "GYTOKD"."AUTH_USER_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for AUTH_USER_USER_PERMISSIONS_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."AUTH_USER_USER_PERMISSIONS_SQ";
CREATE SEQUENCE "GYTOKD"."AUTH_USER_USER_PERMISSIONS_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for BASE_USERS_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."BASE_USERS_SQ";
CREATE SEQUENCE "GYTOKD"."BASE_USERS_SQ" MINVALUE 1 MAXVALUE 99999999999 INCREMENT BY 1 CACHE 10;

-- ----------------------------
-- Sequence structure for BASE_USER_GROUP_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."BASE_USER_GROUP_SQ";
CREATE SEQUENCE "GYTOKD"."BASE_USER_GROUP_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for BASE_USER_INFO_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."BASE_USER_INFO_SQ";
CREATE SEQUENCE "GYTOKD"."BASE_USER_INFO_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for DJANGO_ADMIN_LOG_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."DJANGO_ADMIN_LOG_SQ";
CREATE SEQUENCE "GYTOKD"."DJANGO_ADMIN_LOG_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for DJANGO_APSCHEDULER_DJAN85FC_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."DJANGO_APSCHEDULER_DJAN85FC_SQ";
CREATE SEQUENCE "GYTOKD"."DJANGO_APSCHEDULER_DJAN85FC_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for DJANGO_APSCHEDULER_DJAN899E_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."DJANGO_APSCHEDULER_DJAN899E_SQ";
CREATE SEQUENCE "GYTOKD"."DJANGO_APSCHEDULER_DJAN899E_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for DJANGO_CONTENT_TYPE_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."DJANGO_CONTENT_TYPE_SQ";
CREATE SEQUENCE "GYTOKD"."DJANGO_CONTENT_TYPE_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for DJANGO_MIGRATIONS_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."DJANGO_MIGRATIONS_SQ";
CREATE SEQUENCE "GYTOKD"."DJANGO_MIGRATIONS_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for GYITEMCODE_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."GYITEMCODE_SQ";
CREATE SEQUENCE "GYTOKD"."GYITEMCODE_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for KDSTOCKCODE_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."KDSTOCKCODE_SQ";
CREATE SEQUENCE "GYTOKD"."KDSTOCKCODE_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for KINGDEEWEBAPI_OUTSTOCKRCF97_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKRCF97_SQ";
CREATE SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKRCF97_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for KINGDEEWEBAPI_OUTSTOCKREV_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKREV_SQ";
CREATE SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKREV_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for KINGDEEWEBAPI_OUTSTOCKSE1D0_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKSE1D0_SQ";
CREATE SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKSE1D0_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for KINGDEEWEBAPI_OUTSTOCKSUM_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKSUM_SQ";
CREATE SEQUENCE "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKSUM_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for NAS_GROUP_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."NAS_GROUP_SQ";
CREATE SEQUENCE "GYTOKD"."NAS_GROUP_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for PURCHASEORDERCODE_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."PURCHASEORDERCODE_SQ";
CREATE SEQUENCE "GYTOKD"."PURCHASEORDERCODE_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for TASKS_JOBEXEC_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."TASKS_JOBEXEC_SQ";
CREATE SEQUENCE "GYTOKD"."TASKS_JOBEXEC_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for USERS_KEYVALUE_SQ
-- ----------------------------
DROP SEQUENCE "GYTOKD"."USERS_KEYVALUE_SQ";
CREATE SEQUENCE "GYTOKD"."USERS_KEYVALUE_SQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Primary Key structure for table BASE_GROUPS
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_GROUPS" ADD CONSTRAINT "SYS_C0051649069" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table BASE_GROUPS
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_GROUPS" ADD CONSTRAINT "SYS_C0051649012" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_GROUPS" ADD CONSTRAINT "SYS_C0051649013" CHECK ("PARENTID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_GROUPS" ADD CONSTRAINT "SYS_C0051649014" CHECK ("COMPANY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_GROUPS" ADD CONSTRAINT "SYS_C0051649015" CHECK ("NASGROUP_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table BASE_USERS
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USERS" ADD CONSTRAINT "SYS_C0051649072" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table BASE_USERS
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USERS" ADD CONSTRAINT "SYS_C0051649016" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USERS" ADD CONSTRAINT "SYS_C0051649017" CHECK ("IS_ACTIVE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USERS" ADD CONSTRAINT "SYS_C0051649018" CHECK ("IS_ADMIN" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USERS" ADD CONSTRAINT "SYS_C0051649019" CHECK ("PERMISSION" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USERS" ADD CONSTRAINT "SYS_C0051649070" CHECK ("IS_ACTIVE" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USERS" ADD CONSTRAINT "SYS_C0051649071" CHECK ("IS_ADMIN" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table BASE_USERS
-- ----------------------------
CREATE TRIGGER "GYTOKD"."BASE_USERS_TR" BEFORE INSERT ON "GYTOKD"."BASE_USERS" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "BASE_USERS_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table BASE_USER_GROUP
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USER_GROUP" ADD CONSTRAINT "SYS_C0051649073" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table BASE_USER_GROUP
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USER_GROUP" ADD CONSTRAINT "SYS_C0051649020" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USER_GROUP" ADD CONSTRAINT "SYS_C0051649021" CHECK ("GID_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USER_GROUP" ADD CONSTRAINT "SYS_C0051649022" CHECK ("UID_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table BASE_USER_GROUP
-- ----------------------------
CREATE INDEX "GYTOKD"."BASE_USER__GID_ID_F86A16CA"
  ON "GYTOKD"."BASE_USER_GROUP" ("GID_ID" ASC)
  LOGGING
  TABLESPACE "GY_DATA_SPACE"
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
);
CREATE INDEX "GYTOKD"."BASE_USER__UID_ID_93CE8896"
  ON "GYTOKD"."BASE_USER_GROUP" ("UID_ID" ASC)
  LOGGING
  TABLESPACE "GY_DATA_SPACE"
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
);

-- ----------------------------
-- Triggers structure for table BASE_USER_GROUP
-- ----------------------------
CREATE TRIGGER "GYTOKD"."BASE_USER_GROUP_TR" BEFORE INSERT ON "GYTOKD"."BASE_USER_GROUP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "BASE_USER_GROUP_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table BASE_USER_INFO
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USER_INFO" ADD CONSTRAINT "SYS_C0051649074" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table BASE_USER_INFO
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USER_INFO" ADD CONSTRAINT "SYS_C0051649043" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USER_INFO" ADD CONSTRAINT "SYS_C0051649044" CHECK ("COMPANY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USER_INFO" ADD CONSTRAINT "SYS_C0051649045" CHECK ("IS_ACTIVE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USER_INFO" ADD CONSTRAINT "SYS_C0051649046" CHECK ("UID_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table BASE_USER_INFO
-- ----------------------------
CREATE INDEX "GYTOKD"."BASE_USER_INFO_UID_ID_5EDFA431"
  ON "GYTOKD"."BASE_USER_INFO" ("UID_ID" ASC)
  LOGGING
  TABLESPACE "GY_DATA_SPACE"
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
);

-- ----------------------------
-- Triggers structure for table BASE_USER_INFO
-- ----------------------------
CREATE TRIGGER "GYTOKD"."BASE_USER_INFO_TR" BEFORE INSERT ON "GYTOKD"."BASE_USER_INFO" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "BASE_USER_INFO_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table IMED_CUSTOMERCODE
-- ----------------------------
ALTER TABLE "GYTOKD"."IMED_CUSTOMERCODE" ADD CONSTRAINT "SYS_C0051649092" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table IMED_CUSTOMERCODE
-- ----------------------------
ALTER TABLE "GYTOKD"."IMED_CUSTOMERCODE" ADD CONSTRAINT "SYS_C0051649035" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_CUSTOMERCODE" ADD CONSTRAINT "SYS_C0051649036" CHECK ("KDID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_CUSTOMERCODE" ADD CONSTRAINT "SYS_C0051649037" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_CUSTOMERCODE" ADD CONSTRAINT "SYS_C0051649091" CHECK ("STATUS" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table IMED_GYITEMCODE
-- ----------------------------
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051649064" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table IMED_GYITEMCODE
-- ----------------------------
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648982" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648983" CHECK ("GYITEMID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648984" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648985" CHECK ("FMATERIALID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648986" CHECK ("GYVOLUME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648987" CHECK ("GYWEIGHT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648988" CHECK ("KDHEIGHT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648989" CHECK ("KDLENGTH" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648990" CHECK ("KDVOLUME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648991" CHECK ("KDWEIGHT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051648992" CHECK ("KDWIDTH" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_GYITEMCODE" ADD CONSTRAINT "SYS_C0051649063" CHECK ("STATUS" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table IMED_GYITEMCODE
-- ----------------------------
CREATE TRIGGER "GYTOKD"."GYITEMCODE_TR" BEFORE INSERT ON "GYTOKD"."IMED_GYITEMCODE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "GYITEMCODE_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table IMED_KDSTOCKCODE
-- ----------------------------
ALTER TABLE "GYTOKD"."IMED_KDSTOCKCODE" ADD CONSTRAINT "SYS_C0051649066" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table IMED_KDSTOCKCODE
-- ----------------------------
ALTER TABLE "GYTOKD"."IMED_KDSTOCKCODE" ADD CONSTRAINT "SYS_C0051648993" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_KDSTOCKCODE" ADD CONSTRAINT "SYS_C0051648994" CHECK ("FSTOCKID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_KDSTOCKCODE" ADD CONSTRAINT "SYS_C0051648995" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."IMED_KDSTOCKCODE" ADD CONSTRAINT "SYS_C0051649065" CHECK ("STATUS" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table IMED_KDSTOCKCODE
-- ----------------------------
CREATE TRIGGER "GYTOKD"."KDSTOCKCODE_TR" BEFORE INSERT ON "GYTOKD"."IMED_KDSTOCKCODE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "KDSTOCKCODE_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table KD2MES_PROD_ORDERS
-- ----------------------------
ALTER TABLE "GYTOKD"."KD2MES_PROD_ORDERS" ADD CONSTRAINT "SYS_C0026256223" PRIMARY KEY ("ROW_ID");

-- ----------------------------
-- Checks structure for table KD2MES_PROD_ORDERS
-- ----------------------------
ALTER TABLE "GYTOKD"."KD2MES_PROD_ORDERS" ADD CONSTRAINT "SYS_C0051649051" CHECK ("ROW_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table KD2MES_STOCK_ORDERS
-- ----------------------------
ALTER TABLE "GYTOKD"."KD2MES_STOCK_ORDERS" ADD CONSTRAINT "SYS_C0026250342" PRIMARY KEY ("CODE");

-- ----------------------------
-- Checks structure for table KD2MES_STOCK_ORDERS
-- ----------------------------
ALTER TABLE "GYTOKD"."KD2MES_STOCK_ORDERS" ADD CONSTRAINT "SYS_C0051649050" CHECK ("CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table OUTSTOCKREV
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKREV" ADD CONSTRAINT "SYS_C0051649056" PRIMARY KEY ("ID");

-- ----------------------------
-- Uniques structure for table OUTSTOCKREV
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKREV" ADD CONSTRAINT "KINGDEEWE_FGYBILLNO_CB856C06_U" UNIQUE ("FGYBILLNO") NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Checks structure for table OUTSTOCKREV
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKREV" ADD CONSTRAINT "SYS_C0051649038" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKREV" ADD CONSTRAINT "SYS_C0051649039" CHECK ("FENTITY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKREV" ADD CONSTRAINT "SYS_C0051649040" CHECK ("FDATE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKREV" ADD CONSTRAINT "SYS_C0051649041" CHECK ("SUMSTATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKREV" ADD CONSTRAINT "SYS_C0051649055" CHECK ("FENTITY" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table OUTSTOCKREV
-- ----------------------------
CREATE TRIGGER "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKREV_TR" BEFORE INSERT ON "GYTOKD"."OUTSTOCKREV" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "KINGDEEWEBAPI_OUTSTOCKREV_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table OUTSTOCKSUM
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKSUM" ADD CONSTRAINT "SYS_C0051649059" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table OUTSTOCKSUM
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKSUM" ADD CONSTRAINT "SYS_C0051648966" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUM" ADD CONSTRAINT "SYS_C0051648967" CHECK ("FDATE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUM" ADD CONSTRAINT "SYS_C0051648968" CHECK ("FENTITY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUM" ADD CONSTRAINT "SYS_C0051648969" CHECK ("STAT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUM" ADD CONSTRAINT "SYS_C0051649057" CHECK ("FENTITY" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUM" ADD CONSTRAINT "SYS_C0051649058" CHECK (("STATUS" IN (0,1)) OR ("STATUS" IS NULL)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table OUTSTOCKSUM
-- ----------------------------
CREATE INDEX "GYTOKD"."OUTSTOCKSUM_FGYBILLNO_4ECE61B7"
  ON "GYTOKD"."OUTSTOCKSUM" ("FGYBILLNO" ASC)
  LOGGING
  TABLESPACE "GY_DATA_SPACE"
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
);

-- ----------------------------
-- Triggers structure for table OUTSTOCKSUM
-- ----------------------------
CREATE TRIGGER "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKSUM_TR" BEFORE INSERT ON "GYTOKD"."OUTSTOCKSUM" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "KINGDEEWEBAPI_OUTSTOCKSUM_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table OUTSTOCKSUMFENTITY
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051649061" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table OUTSTOCKSUMFENTITY
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648970" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648971" CHECK ("FALLAMOUNT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648972" CHECK ("FAMOUNT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648973" CHECK ("FDISCOUNT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648974" CHECK ("FFEEAMOUNT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648975" CHECK ("FISFREE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648976" CHECK ("FPRICE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648977" CHECK ("FQTY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648978" CHECK ("FSERVICEAMOUNT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051648979" CHECK ("OUTSTOCKID_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "SYS_C0051649060" CHECK ("FISFREE" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table OUTSTOCKSUMFENTITY
-- ----------------------------
CREATE INDEX "GYTOKD"."KINGDEEWEB_OUTSTOCKID_287094ED"
  ON "GYTOKD"."OUTSTOCKSUMFENTITY" ("OUTSTOCKID_ID" ASC)
  LOGGING
  TABLESPACE "GY_DATA_SPACE"
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
);

-- ----------------------------
-- Triggers structure for table OUTSTOCKSUMFENTITY
-- ----------------------------
CREATE TRIGGER "GYTOKD"."KINGDEEWEBAPI_OUTSTOCKSE1D0_TR" BEFORE INSERT ON "GYTOKD"."OUTSTOCKSUMFENTITY" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "KINGDEEWEBAPI_OUTSTOCKSE1D0_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table PUBLIC_WIFIINFO
-- ----------------------------
ALTER TABLE "GYTOKD"."PUBLIC_WIFIINFO" ADD CONSTRAINT "SYS_C0051649090" PRIMARY KEY ("NAME");

-- ----------------------------
-- Checks structure for table PUBLIC_WIFIINFO
-- ----------------------------
ALTER TABLE "GYTOKD"."PUBLIC_WIFIINFO" ADD CONSTRAINT "SYS_C0051649011" CHECK ("NAME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table ROBOT_MESSAGES
-- ----------------------------
ALTER TABLE "GYTOKD"."ROBOT_MESSAGES" ADD CONSTRAINT "SYS_C0051649080" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table ROBOT_MESSAGES
-- ----------------------------
ALTER TABLE "GYTOKD"."ROBOT_MESSAGES" ADD CONSTRAINT "SYS_C0051649047" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."ROBOT_MESSAGES" ADD CONSTRAINT "SYS_C0051649048" CHECK ("TALK_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."ROBOT_MESSAGES" ADD CONSTRAINT "SYS_C0051649049" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table ROBOT_TALKS
-- ----------------------------
ALTER TABLE "GYTOKD"."ROBOT_TALKS" ADD CONSTRAINT "SYS_C0051649082" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table ROBOT_TALKS
-- ----------------------------
ALTER TABLE "GYTOKD"."ROBOT_TALKS" ADD CONSTRAINT "SYS_C0051649023" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."ROBOT_TALKS" ADD CONSTRAINT "SYS_C0051649024" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."ROBOT_TALKS" ADD CONSTRAINT "SYS_C0051649081" CHECK ("STATUS" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table STOCK_PURCHASEORDER
-- ----------------------------
ALTER TABLE "GYTOKD"."STOCK_PURCHASEORDER" ADD CONSTRAINT "SYS_C0051649067" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table STOCK_PURCHASEORDER
-- ----------------------------
ALTER TABLE "GYTOKD"."STOCK_PURCHASEORDER" ADD CONSTRAINT "SYS_C0051648996" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."STOCK_PURCHASEORDER" ADD CONSTRAINT "SYS_C0051648997" CHECK ("COMPLETE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."STOCK_PURCHASEORDER" ADD CONSTRAINT "SYS_C0051648998" CHECK ("FSTOCKID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."STOCK_PURCHASEORDER" ADD CONSTRAINT "SYS_C0051648999" CHECK ("MUSTQTY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."STOCK_PURCHASEORDER" ADD CONSTRAINT "SYS_C0051649000" CHECK ("PRICE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."STOCK_PURCHASEORDER" ADD CONSTRAINT "SYS_C0051649001" CHECK ("REALQTY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table STOCK_PURCHASEORDER
-- ----------------------------
CREATE TRIGGER "GYTOKD"."PURCHASEORDERCODE_TR" BEFORE INSERT ON "GYTOKD"."STOCK_PURCHASEORDER" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "PURCHASEORDERCODE_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table SYS_GYERP_USERS
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_GYERP_USERS" ADD CONSTRAINT "SYS_C0051649083" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table SYS_GYERP_USERS
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_GYERP_USERS" ADD CONSTRAINT "SYS_C0051649025" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_GYERP_USERS" ADD CONSTRAINT "SYS_C0051649026" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_KINGDEE_DATACENTER
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_KINGDEE_DATACENTER" ADD CONSTRAINT "SYS_C0051649085" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table SYS_KINGDEE_DATACENTER
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_KINGDEE_DATACENTER" ADD CONSTRAINT "SYS_C0051649027" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_KINGDEE_DATACENTER" ADD CONSTRAINT "SYS_C0051649028" CHECK ("TEST" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_KINGDEE_DATACENTER" ADD CONSTRAINT "SYS_C0051649084" CHECK ("TEST" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_KINGDEE_USERS
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_KINGDEE_USERS" ADD CONSTRAINT "SYS_C0051649086" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table SYS_KINGDEE_USERS
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_KINGDEE_USERS" ADD CONSTRAINT "SYS_C0051649029" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_KINGDEE_USERS" ADD CONSTRAINT "SYS_C0051649030" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_NAS_GROUP
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_NAS_GROUP" ADD CONSTRAINT "SYS_C0051649052" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table SYS_NAS_GROUP
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_NAS_GROUP" ADD CONSTRAINT "SYS_C0051649004" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_GROUP" ADD CONSTRAINT "SYS_C0051649005" CHECK ("APP_GROUP_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_GROUP" ADD CONSTRAINT "SYS_C0051649006" CHECK ("CHECKED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_GROUP" ADD CONSTRAINT "SYS_C0051649053" CHECK ("CHECKED" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table SYS_NAS_GROUP
-- ----------------------------
CREATE TRIGGER "GYTOKD"."NAS_GROUP_TR" BEFORE INSERT ON "GYTOKD"."SYS_NAS_GROUP" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "NAS_GROUP_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table SYS_NAS_USER
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_NAS_USER" ADD CONSTRAINT "SYS_C0051649077" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table SYS_NAS_USER
-- ----------------------------
ALTER TABLE "GYTOKD"."SYS_NAS_USER" ADD CONSTRAINT "SYS_C0051649007" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_USER" ADD CONSTRAINT "SYS_C0051649008" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_USER" ADD CONSTRAINT "SYS_C0051649009" CHECK ("GROUP_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_USER" ADD CONSTRAINT "SYS_C0051649010" CHECK ("CHECKED" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_USER" ADD CONSTRAINT "SYS_C0051649075" CHECK ("STATUS" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."SYS_NAS_USER" ADD CONSTRAINT "SYS_C0051649076" CHECK ("CHECKED" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table TASKS_JOBEXEC
-- ----------------------------
ALTER TABLE "GYTOKD"."TASKS_JOBEXEC" ADD CONSTRAINT "SYS_C0051649087" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table TASKS_JOBEXEC
-- ----------------------------
ALTER TABLE "GYTOKD"."TASKS_JOBEXEC" ADD CONSTRAINT "SYS_C0051649042" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table TASKS_JOBEXEC
-- ----------------------------
CREATE TRIGGER "GYTOKD"."TASKS_JOBEXEC_TR" BEFORE INSERT ON "GYTOKD"."TASKS_JOBEXEC" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "TASKS_JOBEXEC_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table TASKS_JOBS
-- ----------------------------
ALTER TABLE "GYTOKD"."TASKS_JOBS" ADD CONSTRAINT "SYS_C0051649089" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table TASKS_JOBS
-- ----------------------------
ALTER TABLE "GYTOKD"."TASKS_JOBS" ADD CONSTRAINT "SYS_C0051649002" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."TASKS_JOBS" ADD CONSTRAINT "SYS_C0051649003" CHECK ("UP_STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."TASKS_JOBS" ADD CONSTRAINT "SYS_C0051649088" CHECK ("UP_STATUS" IN (0,1)) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table TEMP_KEYVALUE
-- ----------------------------
ALTER TABLE "GYTOKD"."TEMP_KEYVALUE" ADD CONSTRAINT "SYS_C0051649062" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table TEMP_KEYVALUE
-- ----------------------------
ALTER TABLE "GYTOKD"."TEMP_KEYVALUE" ADD CONSTRAINT "SYS_C0051648980" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."TEMP_KEYVALUE" ADD CONSTRAINT "SYS_C0051648981" CHECK ("KVTS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Triggers structure for table TEMP_KEYVALUE
-- ----------------------------
CREATE TRIGGER "GYTOKD"."USERS_KEYVALUE_TR" BEFORE INSERT ON "GYTOKD"."TEMP_KEYVALUE" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW WHEN (new."ID" IS NULL) 
BEGIN
        SELECT "USERS_KEYVALUE_SQ".nextval
        INTO :new."ID" FROM dual;
    END;
/

-- ----------------------------
-- Primary Key structure for table XIAOSHOU_KANBAN
-- ----------------------------
ALTER TABLE "GYTOKD"."XIAOSHOU_KANBAN" ADD CONSTRAINT "SYS_C0051649078" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table XIAOSHOU_KANBAN
-- ----------------------------
ALTER TABLE "GYTOKD"."XIAOSHOU_KANBAN" ADD CONSTRAINT "SYS_C0051649031" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."XIAOSHOU_KANBAN" ADD CONSTRAINT "SYS_C0051649032" CHECK ("PERSENT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."XIAOSHOU_KANBAN" ADD CONSTRAINT "SYS_C0051649033" CHECK ("USER" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "GYTOKD"."XIAOSHOU_KANBAN" ADD CONSTRAINT "SYS_C0051649034" CHECK ("MODIFY_DATE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Foreign Keys structure for table BASE_USER_GROUP
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USER_GROUP" ADD CONSTRAINT "BASE_USER_GID_ID_F86A16CA_F" FOREIGN KEY ("GID_ID") REFERENCES "GYTOKD"."BASE_GROUPS" ("ID") DEFERRABLE INITIALLY DEFERRED NORELY VALIDATE;
ALTER TABLE "GYTOKD"."BASE_USER_GROUP" ADD CONSTRAINT "BASE_USER_UID_ID_93CE8896_F" FOREIGN KEY ("UID_ID") REFERENCES "GYTOKD"."BASE_USER_INFO" ("ID") DEFERRABLE INITIALLY DEFERRED NORELY VALIDATE;

-- ----------------------------
-- Foreign Keys structure for table BASE_USER_INFO
-- ----------------------------
ALTER TABLE "GYTOKD"."BASE_USER_INFO" ADD CONSTRAINT "BASE_USER_UID_ID_5EDFA431_F" FOREIGN KEY ("UID_ID") REFERENCES "GYTOKD"."BASE_USERS" ("ID") DEFERRABLE INITIALLY DEFERRED NORELY VALIDATE;

-- ----------------------------
-- Foreign Keys structure for table OUTSTOCKSUMFENTITY
-- ----------------------------
ALTER TABLE "GYTOKD"."OUTSTOCKSUMFENTITY" ADD CONSTRAINT "KINGDEEWE_OUTSTOCKI_287094ED_F" FOREIGN KEY ("OUTSTOCKID_ID") REFERENCES "GYTOKD"."OUTSTOCKSUM" ("ID") DEFERRABLE INITIALLY DEFERRED NORELY VALIDATE;
